package com.shuai.frame.factory;

import com.shuai.frame.fault.retry.RetryStrategy;
import com.shuai.frame.loadbalancer.LoadBalancer;
import com.shuai.frame.spi.XSRpcSPILoader;

/**
 * @author: bxs
 * @version: 1.0
 * @Date: 2024/7/28
 */
public class RetryStrategyFactory {
    static {
        XSRpcSPILoader.loadSPIImpl();
    }

    public static RetryStrategy getRetryStrategy(String retryStrategyKey) {
        try {
            return XSRpcSPILoader.getInstance(RetryStrategy.class, retryStrategyKey);
        } catch (InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
}
